<template>
  <div>
    <comEdit />
    
    <!-- <div v-if="articleObj.status == 0">
      <span>新建笔记</span>
    </div>
    <div v-if="articleObj.status == 1">
      <span>编辑笔记</span>
    </div>
    <div v-if="articleObj.status == 2">
      <span>查看笔记</span>
    </div> -->
  </div>
</template>

<script>
import comEdit from '@/components/comEdit';

export default {
  components: {
    comEdit,
  },
  data() {
    return {
      articleObj: {
        status: '0', // 0：新建， 1：编辑， 2： 只读
        articleId: '000',
        user_id: '000-000-000',
      },
    }
  },
  methods: {
    getData() {
      let user = window.sessionStorage.getItem('user');
      let dealUser = JSON.parse(user);
      const params = this.$route.query; // news页面接收传过来的值

      this.articleObj.user_id = dealUser._id;
      this.articleObj.status = params.status;
      this.articleObj.articleId = params.articleId;

      // console.log(this.$route, 'user', user2);
      // console.log(this.articleObj);
    },
  },
  mounted() {
    this.getData();
  },
}
</script>

<style lang="scss" scoped>

</style>